package com.zt.student.service.impl;

import com.zt.common.pojo.Course;
import com.zt.student.dao.CourseDao;
import com.zt.student.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * description:
 * author:zt
 * date:2022-01-11
 */
@Service
@Transactional
public class CourseServiceImpl implements CourseService {

    @Autowired
    private CourseDao courseDao;

    @Override
    public Course getCourseById(int id) {
        return courseDao.getCourseById(id);
    }

    @Override
    public boolean isCompulsory(int id) {
        Course course = courseDao.getCourseById(id);
        return course.getType()==0;
    }
}
